/*******************************************************************************
 * This file is part of blueprint4j www.blueprint4j.org.
 * 
 *     blueprint4j is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 * 
 *     blueprint4j is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 * 
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with blueprint4j. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
/**
* This field accepts hex coded deciamal
* 0-9 A-F a-f
* this field pads with '0' on the left
* $Log: FieldH.java,v $
* Revision 1.1.1.1  2004/04/22 12:56:14  travisb
* Fir
*
* Revision 1.1.1.1  2003/12/21 09:04:08  jaspervdb
* no message
*
* Revision 1.1.1.1  2003/10/20 15:30:48  travisb
* First import into CVS at Cellstop
*
* Revision 1.1.1.1  2003/03/30 15:25:28  tbulford
* no message
*
* Revision 1.1  2003/01/12 08:30:34  travis
* Import x MANY
*
* Revision 1.1.1.1  2002/12/16 22:14:01  jasper
* no message
*
* Revision 1.1  2002/02/20 13:30:43  JasperV
* First time add to new Applications layer
*
* Revision 1.1  2002/01/24 14:18:14  travisb
* First Version of the Application Layer
*
* Revision 1.1  2002/01/21 08:06:07  travisb
* First version commited to CVS
*
*/

package blueprint4j.messages;

import java.io.*;
import java.util.*;

public class FieldH extends FieldN {
	static String ok_values = "0123456789abcdefABCDEF";

	public FieldH( int p_fieldsize_type, int p_fieldsize, int p_field_position, String _name )
	throws ExceptionMessage {
		super( p_fieldsize_type, p_fieldsize, p_field_position ,_name);
	}

	void verify( String p_value )
	throws ExceptionMessage {
		// Check value
		for ( int t = 0;t < p_value.length();t++ ) {
			if ( ok_values.indexOf( p_value.substring( t, t + 1 ) ) == -1 ) {
				throw new ExceptionMessage( "Field value found that is not formatted correctly for field "+field_position+" with value ["+p_value+"]" );
			}
		}
	}
}

